Skip to content

Conversation

@murali-db
Copy link
Collaborator

@murali-db murali-db commented Nov 14, 2025

ℹ️ This is the first PR in a 5-part series. Review PRs in order: #1477#1478#1479#1480#1481


This is part 1 of 5 PRs that implement schema diffing for Delta Kernel Rust.

What's in this PR

  • Core data structures: SchemaDiff, FieldChange, FieldUpdate
  • FieldChangeType enum for classifying changes
  • SchemaDiffError for validation errors
  • ColumnName::parent() helper method
  • Basic test infrastructure
  • Feature gate to prevent activation until all PRs merge

What's NOT in this PR

  • Actual diffing logic (coming in PR 2)
  • Nested struct support (PR 3)
  • Array tests (PR 4)
  • Map tests (PR 5)

Feature Gating

This PR includes const SCHEMA_DIFF_ENABLED: bool = false with a #[cfg(not(test))] guard.

  • Production code returns empty diff (safe if this PR merges before others)
  • Tests bypass the gate to validate implementation
  • Gate will be removed in PR 5 when all functionality is complete

Part of #1346

Introduces core data structures for schema diffing:
- SchemaDiff, FieldChange, FieldUpdate types
- FieldChangeType enum for classifying changes
- SchemaDiffError for validation errors
- ColumnName::parent() helper method

This is part 1/5 of the schema diffing feature implementation.
The actual diffing algorithm will be added in PR 2.

Note: This PR includes a temporary stub for compute_schema_diff()
to allow basic tests to compile. The full implementation from the
original PR delta-io#1346 will be copied exactly in PR 2.

Related to delta-io#1346
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 90.56604% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.89%. Comparing base (fe01172) to head (31cee42).

Files with missing lines Patch % Lines
kernel/src/schema/diff.rs 93.50% 8 Missing and 2 partials ⚠️
kernel/src/expressions/column_names.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1477      +/-   ##
==========================================
+ Coverage   84.84%   84.89%   +0.05%     
==========================================
  Files         120      121       +1     
  Lines       32103    32262     +159     
  Branches    32103    32262     +159     
==========================================
+ Hits        27238    27390     +152     
- Misses       3542     3547       +5     
- Partials     1323     1325       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Adds a comprehensive unit test that exercises the filtering logic by
manually constructing a SchemaDiff with both top-level and nested
field changes. This test verifies that the methods correctly filter
fields by path depth (length 1 vs length > 1).

The test improves code coverage for these methods from 0% to full
coverage of the filtering logic, addressing CI coverage requirements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants